﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;

namespace CloundUploader.Framework.User
{
  public class User
    {
      public string Identity { get; set; }
      public string Name { get; set; }
      public string Pass { get; set; }
      public bool IsLogin { get; set; }
      public string Rights { get; set; }
      public UserUploadSetting UploadSetting { get; set; }
      public List<WebUser> WebUsers { get; set; }

      public User()
      {
          WebUsers=new List<WebUser>();
      }

      public WebUser GetWebUser(string code)
      {
          return WebUsers.SingleOrDefault(u=>u.WebCode==code);
      }
    }

    public class WebUser
    {
        public string WebCode { get; set; }
        public string Name { get; set; }
        public string Pass { get; set; }
        public CookieContainer CookieContainer { get; set; }
        public string Cookie { get; set; }
    }
}
